import { defineStore } from 'pinia'
import { ref } from 'vue'

export const useLanguageStore = defineStore(
  'language',
  () => {
    const language = ref('zhCn') // 默认是中文

    const changeLanguage = (value: 'en' | 'zhCn') => {
      language.value = value
    }

    return {
      language,
      changeLanguage
    }
  },
  {
    persist: true
  }
)
